/**
 * Created with Intellij IDEA
 * Description
 * User:ASUS
 * Date:2024-07-25
 * Time:22:07
 */
import java.util.Random;
import java.util.Scanner;
public class Test {
    public static void main(String[] args) {
        Random random=new Random();//默认随机种子是系统时间
        Scanner sc=new Scanner(System.in);
        int toGuess=random.nextInt(100);//[0,100)
        while(true){
            System.out.println("请输入要猜的数字 （1~100）：  ");
            int sum=sc.nextInt();
            if(sum<toGuess){
                System.out.println("猜小了");
            }else if(sum>toGuess){
                System.out.println("猜大了");
            }else{
                System.out.println("猜对了");
                break;
            }
        }
        sc.close();
    }
}
